package com.wlhse.service.impl;

import com.wlhse.dao.OversightDao;
import com.wlhse.dto.outDto.HomeProblemOutDto;
import com.wlhse.exception.WLHSException;
import com.wlhse.service.HomeProblemService;
import com.wlhse.util.state_code.CodeDict;
import com.wlhse.util.state_code.NR;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class HomeProblemServiceImpl implements HomeProblemService {

    @Resource
    private OversightDao oversightDao;

    @Override
    public String getHomeProblem() {
        HomeProblemOutDto homeProblemOutDto = oversightDao.queryHomeProblemOutDto();
        if (homeProblemOutDto == null)
            throw new WLHSException("查询失败");
        return NR.r(homeProblemOutDto);
    }
}
